<#import '/ftlLibrary/properteisVariable.ftl' as pv/>
<div class="row">
    <div class="row" style="text-align: center;padding-top: 1px;min-height: 56px">
        <div class="col-xs-10 col-xs-offset-1">
            <div class="col-xs-3 nopadding">
                <button type="btn" class="btn col-xs-12 parentChildBtn" style="border-color: #5db2ff!important;background-color: #5db2ff">亲子</button>
            </div>
            <div class="col-xs-3 nopadding">
                <button type="btn" class="btn col-xs-12 interimBtn" style="border-color: #5db2ff!important;">过渡</button>
            </div>
            <!--<div class="col-xs-3 nopadding">
                <button type="btn" class="btn col-xs-12 disposableBtn" style="border-color: #5db2ff!important;">一次性物品缴费</button>
            </div>
            <div class="col-xs-3 nopadding">
                <button type="btn" class="btn col-xs-12 otherBtn" style="border-color: #5db2ff!important;">其他费用</button>
            </div>-->
        </div>
    </div>
    <form class="editForm" action="${saveUrl}" method="post" responseType="JSON" role="form"
          id="editForm_${serializeNum}"
          data-bv-submitButtons="#editFormSubmitBtn_${serializeNum}"
          data-bv-message="This value is not valid"
          data-bv-feedbackicons-valid="glyphicon glyphicon-ok"
          data-bv-feedbackicons-invalid="glyphicon glyphicon-remove"
          data-bv-feedbackicons-validating="glyphicon glyphicon-refresh">
        <input type="hidden" name="id" value="${editEntity.id}">
        <input type="hidden" name="targetDataId" value="${targetDataId}">
        <input type="hidden" name="memberType" value="${memberType}">
        <input type="hidden" class="packageType" name="packageType" value="1"/>

        <div class="parentChild show">
            <div class="col-xm-12 col-sm-6 col-lg-12 margin-bottom-20 margin-top-10">
                <div class="form-group">
                    <label for="number"
                           class="col-sm-3 col-sm-offset-1 control-label no-padding-right"><span style="color: red">*</span>合同编号：</label>
                    <div class="col-sm-6">
                        <input data-bv-message="The field is not valid" size="50" name="dearSonContractNumber"
                               alt="合同编号"
                               placeholder="HT10001010" type="text" title="合同编号" class="form-control"
                               value="${editEntity.number}"/>
                        <span class="text"></span>
                    </div>
                </div>
            </div>

                <div class="col-xm-12 col-sm-6 col-lg-12 margin-bottom-20">
                    <div class="form-group">
                        <label for="adminUserId"
                               class="col-sm-3 col-sm-offset-1 control-label no-padding-right">所属顾问：</label>
                        <div class="col-sm-6">
                            <!--<select name="adminUserId" id="adminUserId" class="col-sm-5" value="${editEntity.adminUserId}" style="height: 32px;">
                                <option value="">王依依</option>
                            </select>-->
                            <select name="dearSonStaffId" id="dearSonStaffId" class="col-sm-5" value=""
                                    style="height: 32px;">
                                <!-- <option id="staffselectDearSon" value="">请选择</option>
                                 <#list SysAdminUserList as data>
                                     <option  value="${data.id}">${data.name}</option>
                                 </#list>-->
                            </select>

                        </div>
                    </div>
                </div>
                <div class="col-xm-12 col-sm-6 col-lg-12 margin-bottom-20">
                    <div class="form-group">
                        <label for="packageId"
                               class="col-sm-3 col-sm-offset-1  control-label no-padding-right"><span style="color: red">*</span>课时包名称：</label>
                        <div class="col-sm-6">
                            <!--<select name="packageId" id="packageId" class="col-sm-12">
                                <option value="">2017亲子96课时</option>
                            </select>-->
                            <select name="dearSonPackageId" id="dearSonPackageId" class="col-sm-12 addressProvince"
                                    onchange="packageCheck(this)">
                                <!--<option id="selectPackageDearSon" value="">请选择</option>
                                <#list dearSonPackageList as data>
                                    <option  value="${data.id}" packageId=${data.id} packageOriginalUnitPrice=${data.originalUnitPrice}
                                             packageValidDate=${data.validDate} packageTotalClassHour=${data.totalClassHour} >${data.name}</option>
                                </#list>-->
                            </select>
                            <!--<input data-bv-message="The field is not valid" size="32" name="packageId" alt="课时包Id"-->
                            <!--id="packageId" placeholder="课时包Id" type="text" title="课时包Id" class="form-control"
                            <!--value="${editEntity.packageId}"/>-->
                            <!--<span class="text"></span>-->
                        </div>
                    </div>
                </div>
                <div class="col-xm-12 col-sm-6 col-lg-12 margin-bottom-20">
                    <div class="form-group">
                        <label class="col-sm-3 col-sm-offset-1 control-label no-padding-right">
                            <span style="color: red">*</span>可用课时数：</label>
                        <label class="col-sm-6">
                            <label>
                                <input class="form-control" type="text" style="width:60px;height: 30px!important;"
                                       name="classHour" id="classHour" value="${editEntity.classHour}">
                            </label>
                            <label>
                                课时 +
                            </label>
                            <label>
                                <input class="form-control" type="text" style="width: 40px;height: 30px!important;"
                                       name="presentClassHour" id="presentClassHour"
                                       value="${editEntity.presentClassHour}">
                            </label>
                            <label>
                                赠送课时
                            </label>
                            <!--<input data-bv-integer-message="The field is number" data-bv-message="The field is not valid"-->
                            <!--data-bv-integer="true" size="11" name="classHour" alt="课时数" id="classHour"-->
                            <!--placeholder="课时数" type="text" title="课时数" class="form-control"-->
                            <!--value="${editEntity.classHour}"/>-->
                            <!--<span class="text"></span>-->
                        </label>
                    </div>
                </div>
            <div class="col-xm-12 col-sm-6 col-lg-12 margin-bottom-20">
            <div class="form-group">
            <label for="nowUnitPrice" class="col-sm-3 col-sm-offset-1 control-label no-padding-right">课时包原单价：</label>
            <label class="col-sm-6">
            <label>
            <input class="form-control" type="text" style="width:60px;height: 30px!important;"
            name="dearSonOriginalUnitPrice" id="dearSonOriginalUnitPrice"
            value="${editEntity.originalUnitPrice}">
            </label>
            <label>
            元
            </label>
            <!--<input data-bv-numeric="true" data-bv-message="The field is not valid"-->
            <!--data-bv-numeric-message="The field is numeric" size="22" name="originalUnitPrice"-->
            <!--alt="课时包原单价" id="originalUnitPrice" placeholder="课时包原单价" type="text" title="课时包原单价"-->
            <!--class="form-control" value="${editEntity.originalUnitPrice}"/>-->
            <!--<span class="text"></span>-->
            </label>
            </div>
            </div>
            <div class="col-xm-12 col-sm-6 col-lg-12 margin-bottom-20">
            <div class="form-group">
            <label for="nowUnitPrice" class="col-sm-3 col-sm-offset-1 control-label no-padding-right">课时包现单价：</label>
            <label class="col-sm-6">
            <label>
            <input class="form-control" type="text" style="width:60px;height: 30px!important;"
            name="dearSonNowUnitPrice" id="dearSonNowUnitPrice" value="${editEntity.nowUnitPrice}"
            onblur="calculation(this)">
            </label>
            <label>
            元
            </label>
            <!--<input data-bv-numeric="true" data-bv-message="The field is not valid"-->
            <!--data-bv-numeric-message="The field is numeric" size="22" name="nowUnitPrice" alt="课时包现单价"-->
            <!--id="nowUnitPrice" placeholder="课时包现单价" type="text" title="课时包现单价" class="form-control"-->
            <!--value="${editEntity.nowUnitPrice}"/>-->
            <!--<span class="text"></span>-->
            </label>
            </div>
            </div>
                <div class="col-xm-12 col-sm-6 col-lg-12 margin-bottom-20">
                    <div class="form-group">
                        <label for="sumPrice"
                               class="col-sm-3 col-sm-offset-1 control-label no-padding-right">课时包总价：</label>
                        <label class="col-sm-6">
                            <label>
                                <input class="form-control" type="text" style="width:60px;height: 30px!important;"
                                       name="dearSonPackageSumPrice" id="dearSonPackageSumPrice" value="${editEntity.sumPrice}">
                            </label>
                            <label>
                                元
                            </label>
                            <!--<input data-bv-numeric="true" data-bv-message="The field is not valid"-->
                            <!--data-bv-numeric-message="The field is numeric" size="22" name="sumPrice" alt="课时包总价"-->
                            <!--id="sumPrice" placeholder="课时包总价" type="text" title="课时包总价" class="form-control"-->
                            <!--value="${editEntity.sumPrice}"/>-->
                            <!--<span class="text"></span>-->
                        </label>
                    </div>
                </div>
                <div class="col-xm-12 col-sm-6 col-lg-12 margin-bottom-20">
                    <div class="form-group">
                        <label for="dearSonValidDate"
                               class="col-sm-3 col-sm-offset-1 control-label no-padding-right">有效期：</label>
                        <label class="col-sm-6">
                            <label>
                                <input class="form-control" type="text" style="width:60px;height: 30px!important;"
                                       name="dearSonValidDate" id="dearSonValidDate" value="${editEntity.validDate}">
                            </label>
                            <label>
                                个月
                            </label>
                            <label>
                                <button type="btn" class="btn btn-blue"
                                        style="border-color: #5db2ff!important;height:30px ;">激活
                                </button>
                            </label>
                            <small class="help-block" style="">（注：激活后将从今日起开始计算有效期）</small>
                            <!--<input data-bv-integer-message="The field is number" data-bv-message="The field is not valid"-->
                            <!--data-bv-integer="true" size="11" name="validDate" alt="有效期" id="validDate"-->
                            <!--placeholder="有效期" type="text" title="有效期" class="form-control"-->
                            <!--value="${editEntity.validDate}"/>-->
                            <!--<span class="text"></span>-->
                        </label>
                    </div>
                </div>
                <div class="col-xm-12 col-sm-6 col-lg-12 margin-bottom-20 margin-top-10">
                    <div class="form-group">
                        <label for="number"
                               class="col-sm-3 col-sm-offset-1 control-label no-padding-right">已缴纳定金：</label>
                        <div class="col-sm-6">
                            <label>
                                <input class="form-control" type="text" name="dearSonDeposit" id="dearSonDeposit" value="${deposit}">
                            </label>
                            <label>
                                元
                            </label>
                        </div>
                    </div>
                </div>
                <div class="col-xm-12 col-sm-6 col-lg-12 margin-bottom-20 margin-top-10">
                    <div class="form-group">
                        <label for="number"
                               class="col-sm-3 col-sm-offset-1 control-label no-padding-right">应支付总额：</label>
                        <div class="col-sm-6">
                            <label>
                                <input class="form-control" type="text" style="width:60px;height: 30px!important;"
                                       name="dearSonSumPrice" id="dearSonSumPrice" value="${editEntity.sumPrice}">
                            </label>
                            <label>
                                元
                            </label>
                        </div>
                    </div>
                </div>
                <div class="col-xm-12 col-sm-6 col-lg-12 margin-bottom-20">
                    <div class="form-group">
                        <label for="remark" class="col-sm-3 col-sm-offset-1 control-label no-padding-right">备注：</label>
                        <div class="col-sm-6">
                            <textarea class="form-control" name="dearSonRemark" size="500" rows="2" style="resize:none"
                                      id="remark" value="${editEntity.remark}"></textarea>
                            <!--<input data-bv-message="The field is not valid" size="500" name="remark" alt="备注" id="remark"-->
                            <!--placeholder="备注" type="text" title="备注" class="form-control"-->
                            <!--value="${editEntity.remark}"/>-->
                            <!--<span class="text"></span>-->
                        </div>
                    </div>
                </div>
            <div class="col-sm-12 margin-bottom-20 margin-top-10">
                <div class="text-align-center">
                    <button style="width: 80px;margin-right: 20px" class="btn btn-blue" type="submit"
                            id="editFormSubmitBtn_${serializeNum}">确定
                    </button>
                    <input style="width: 80px" type="button" class="btn btn-blue" data-dismiss="modal" value="取消"
                           />

                </div>
            </div>
        </div>
        <div class="interim hidden">
                <div class="col-xm-12 col-sm-6 col-lg-12 margin-bottom-20 margin-top-10">
                    <div class="form-group">
                        <label for="number"
                               class="col-sm-3 col-sm-offset-1 control-label no-padding-right"><span style="color: red">*</span>合同编号：</label>
                        <div class="col-sm-6">
                            <input data-bv-message="The field is not valid" size="50" name="contractNumber" alt="合同编号"
                                   id="number"
                                   placeholder="1020039394" type="text" title="合同编号" class="form-control"
                                   value="${editEntity.number}"/>
                            <span class="text"></span>
                        </div>
                    </div>
                </div>
                <div class="col-xm-12 col-sm-6 col-lg-12 margin-bottom-20">
                    <div class="form-group">
                        <label for="adminUserId" class="col-sm-3 col-sm-offset-1 control-label no-padding-right"><span
                                style="color: red">*</span>所属顾问：</label>
                        <div class="col-sm-6">
                            <!--<select name="adminUserId" id="adminUserId" class="col-sm-5" value="${editEntity.adminUserId}" style="height: 32px;">
                                <option value="">王依依</option>
                            </select>-->
                            <select name="adminUserId" id="adminUserId" class="col-sm-5" value="" style="height: 32px;">
                                <option id="staffselect" value="">请选择</option>
                                <#list SysAdminUserList as data>
                                    <option value="${data.id}">${data.name}</option>
                                </#list>
                            </select>

                            <!--<input data-bv-message="The field is not valid" size="32" name="adminUserId" alt="所属顾问" id="adminUserId"-->
                            <!--placeholder="所属顾问" type="text" title="所属顾问" class="form-control"-->
                            <!--value="${editEntity.adminUserId}"/>-->
                            <!--<span class="text"></span>-->
                        </div>
                    </div>
                </div>
                <div class="col-xm-12 col-sm-6 col-lg-12 margin-bottom-20">
                    <div class="form-group">
                        <label for="packageId"
                               class="col-sm-3 col-sm-offset-1  control-label no-padding-right"><span
                                style="color: red">*</span>课时包名称：</label>
                        <div class="col-sm-6">
                            <!--<select class="col-sm-12">
                                <option value="">2017预科月卡</option>
                            </select>-->
                            <select name="packageId" id="packageId" class="col-sm-12" onchange="packageCheck(this)">
                                <!--<option id="selectPackage" value="">请选择</option>
                                <#list excessPackageList as excessData>
                                    <option  value="${excessData.id}" packageId=${excessData.id} packageAttendanceDay=${excessData.attendanceDay}
                                             packageValidDate=${excessData.validDate} packageSumPrice=${excessData.sumPrice} >${excessData.name}</option>
                                </#list>-->
                            </select>
                            <!--<input data-bv-message="The field is not valid" size="32" name="packageId" alt="课时包Id"-->
                            <!--id="packageId" placeholder="课时包Id" type="text" title="课时包Id" class="form-control"
                            <!--value="${editEntity.packageId}"/>-->
                            <!--<span class="text"></span>-->
                        </div>
                    </div>
                </div>
                <div class="col-xm-12 col-sm-6 col-lg-12 margin-bottom-20">
                    <div class="form-group">
                        <label for="attendanceDay" class="col-sm-3 col-sm-offset-1 control-label no-padding-right">可出勤天数：</label>
                        <div class="col-sm-6">
                            <label>
                                <input class="form-control" type="text" style="width:60px;height: 30px!important;"
                                       name="packageAttendanceDay" id="packageAttendanceDay" value="${editEntity.classHour}">
                            </label>
                            <label>
                                天/次 + 赠送天数
                            </label>
                            <label>
                                <input class="form-control" type="text" style="width: 40px;height: 30px!important;"
                                       name="attendanceDay" id="attendanceDay"
                                       value="${editEntity.attendanceDay}">
                            </label>
                            <label>
                                天/次
                            </label>

                            <!--<input data-bv-integer-message="The field is number" data-bv-message="The field is not valid"-->
                            <!--data-bv-integer="true" size="11" name="attendanceDay" alt="可出勤天数" id="attendanceDay"-->
                            <!--placeholder="可出勤天数" type="text" title="可出勤天数" class="form-control"-->
                            <!--value="${editEntity.attendanceDay}"/>-->
                            <!--<span class="text"></span>-->
                        </div>
                    </div>
                </div>
                <div class="col-xm-12 col-sm-6 col-lg-12 margin-bottom-20">
                    <div class="form-group">
                        <label for="nowUnitPrice" class="col-sm-3 col-sm-offset-1 control-label no-padding-right">课时包原单价：</label>
                        <label class="col-sm-6">
                            <label>
                                <input class="form-control" type="text" style="width:60px;height: 30px!important;"
                                       name="originalUnitPrice" id="originalUnitPrice"
                                       value="${editEntity.originalUnitPrice}">
                            </label>
                            <label>
                                元
                            </label>
                            <!--<input data-bv-numeric="true" data-bv-message="The field is not valid"-->
                            <!--data-bv-numeric-message="The field is numeric" size="22" name="originalUnitPrice"-->
                            <!--alt="课时包原单价" id="originalUnitPrice" placeholder="课时包原单价" type="text" title="课时包原单价"-->
                            <!--class="form-control" value="${editEntity.originalUnitPrice}"/>-->
                            <!--<span class="text"></span>-->
                        </label>
                    </div>
                </div>
                <div class="col-xm-12 col-sm-6 col-lg-12 margin-bottom-20">
                    <div class="form-group">
                        <label for="nowUnitPrice" class="col-sm-3 col-sm-offset-1 control-label no-padding-right">课时包现单价：</label>
                        <label class="col-sm-6">
                            <label>
                                <input class="form-control" type="text" style="width:60px;height: 30px!important;"
                                       name="nowUnitPrice" id="nowUnitPrice" value="${editEntity.nowUnitPrice}"
                                       onblur="calculation(this)">
                            </label>
                            <label>
                                元
                            </label>
                            <!--<input data-bv-numeric="true" data-bv-message="The field is not valid"-->
                            <!--data-bv-numeric-message="The field is numeric" size="22" name="nowUnitPrice" alt="课时包现单价"-->
                            <!--id="nowUnitPrice" placeholder="课时包现单价" type="text" title="课时包现单价" class="form-control"-->
                            <!--value="${editEntity.nowUnitPrice}"/>-->
                            <!--<span class="text"></span>-->
                        </label>
                    </div>
                </div>
                <div class="col-xm-12 col-sm-6 col-lg-12 margin-bottom-20">
                    <div class="form-group">
                        <label for="sumPrice"
                               class="col-sm-3 col-sm-offset-1 control-label no-padding-right">课时包总价：</label>
                        <label class="col-sm-6">
                            <label>
                                <input class="form-control" type="text" style="width:60px;height: 30px!important;"
                                       name="packageSumPrice" id="packageSumPrice" value="${editEntity.sumPrice}">
                            </label>
                            <label>
                                元
                            </label>
                            <!--<input data-bv-numeric="true" data-bv-message="The field is not valid"-->
                            <!--data-bv-numeric-message="The field is numeric" size="22" name="sumPrice" alt="课时包总价"-->
                            <!--id="sumPrice" placeholder="课时包总价" type="text" title="课时包总价" class="form-control"-->
                            <!--value="${editEntity.sumPrice}"/>-->
                            <!--<span class="text"></span>-->
                        </label>
                    </div>
                </div>
                <div class="col-xm-12 col-sm-6 col-lg-12 margin-bottom-20">
                    <div class="form-group">
                        <label for="validDate" class="col-sm-3 col-sm-offset-1 control-label no-padding-right">有效期：</label>
                        <label class="col-sm-6">
                            <label>
                                <input class="form-control" type="text" style="width:60px;height: 30px!important;"
                                       name="validDate" id="validDate" value="${editEntity.validDate}">
                            </label>
                            <label>
                                个月
                            </label>
                            <label>
                                <button type="btn" class="btn btn-blue"
                                        style="border-color: #5db2ff!important;height:30px ;">激活
                                </button>
                            </label>
                            <small class="help-block" style="">（注：激活后将从今日起开始计算有效期）</small>
                            <!--<input data-bv-integer-message="The field is number" data-bv-message="The field is not valid"-->
                            <!--data-bv-integer="true" size="11" name="validDate" alt="有效期" id="validDate"-->
                            <!--placeholder="有效期" type="text" title="有效期" class="form-control"-->
                            <!--value="${editEntity.validDate}"/>-->
                            <!--<span class="text"></span>-->
                        </label>
                    </div>
                </div>
                <div class="col-xm-12 col-sm-6 col-lg-12 margin-bottom-20">
                    <div class="form-group">
                        <label class="col-sm-3 col-sm-offset-1 control-label no-padding-right"><span style="color: red">*</span>课时包性质：</label>
                        <div class="col-sm-6">
                            <label>
                                <input name="nature" type="radio" value="1">
                                <span class="text" style="margin-top:6px">全日</span>
                            </label>
                            <label>
                                <input name="nature" type="radio" value="2">
                                <span class="text" style="margin-top:6px">半日</span>
                            </label>
                            <!--<input data-bv-integer-message="The field is number" data-bv-message="The field is not valid"-->
                            <!--data-bv-integer="true" size="11" name="nature" alt="课时包性质" id="nature"-->
                            <!--placeholder="课时包性质" type="text" title="课时包性质" class="form-control"-->
                            <!--value="${editEntity.nature}"/>-->
                            <!--<span class="text"></span>-->
                        </div>
                    </div>
                </div>
                <div class="col-xm-12 col-sm-6 col-lg-12 margin-bottom-20">
                    <div class="form-group">
                        <label for="sumPrice"
                               class="col-sm-3 col-sm-offset-1 control-label no-padding-right"><span style="color: red">*</span>一次性物品费：</label>
                        <label class="col-sm-6">
                            <label>
                                <input class="form-control" type="text" name="disposableItems" id="disposableItems">
                            </label>
                            <label>
                                元
                            </label>
                        </label>
                    </div>
                </div>
                <div class="col-xm-12 col-sm-6 col-lg-12 margin-bottom-20">
                    <div class="form-group">
                        <label for="sumPrice"
                               class="col-sm-3 col-sm-offset-1 control-label no-padding-right"><span style="color: red">*</span>日餐点费：</label>
                        <label class="col-sm-6">
                            <label>
                                <input class="form-control" type="text" name="dayMealFee" id="dayMealFee" value="" onblur="mealFeeCalculation(this)">
                            </label>
                            <label>
                                元
                            </label>
                        </label>
                    </div>
                </div>
                <div class="col-xm-12 col-sm-6 col-lg-12 margin-bottom-20">
                    <div class="form-group">
                        <label for="sumPrice"
                               class="col-sm-3 col-sm-offset-1 control-label no-padding-right">餐点费总计：</label>
                        <label class="col-sm-6">
                            <label>
                                <input class="form-control" type="text" name="totalMealFee" id="totalMealFee">
                            </label>
                            <label>
                                元
                            </label>
                        </label>
                    </div>
                </div>
                <div class="col-xm-12 col-sm-6 col-lg-12 margin-bottom-20">
                    <div class="form-group">
                        <label for="sumPrice"
                               class="col-sm-3 col-sm-offset-1 control-label no-padding-right">已缴纳定金：</label>
                        <label class="col-sm-6">
                            <label>
                                <input class="form-control" type="text" name="deposit" id="deposit" value="${deposit}">
                            </label>
                            <label>
                                元
                            </label>
                        </label>
                    </div>
                </div>
                <div class="col-xm-12 col-sm-6 col-lg-12 margin-bottom-20">
                    <div class="form-group">
                        <label for="sumPrice"
                               class="col-sm-3 col-sm-offset-1 control-label no-padding-right">应支付总额：</label>
                        <label class="col-sm-6">
                            <label>
                                <input class="form-control" type="text" style="width:60px;height: 30px!important;"
                                       name="sumPrice" id="sumPrice" value="${editEntity.sumPrice}">
                            </label>
                            <label>
                                元
                            </label>
                        </label>
                    </div>
                </div>
                <div class="col-xm-12 col-sm-6 col-lg-12 margin-bottom-20">
                    <div class="form-group">
                        <label for="remark" class="col-sm-3 col-sm-offset-1 control-label no-padding-right">备注：</label>
                        <div class="col-sm-6">
                            <textarea class="form-control" name="remark" size="500" rows="2" style="resize:none"
                                      value="${editEntity.remark}"></textarea>
                            <!--<input data-bv-message="The field is not valid" size="500" name="remark" alt="备注" id="remark"-->
                            <!--placeholder="备注" type="text" title="备注" class="form-control"-->
                            <!--value="${editEntity.remark}"/>-->
                            <!--<span class="text"></span>-->
                        </div>
                    </div>
                </div>
            <div class="col-sm-12 margin-bottom-20 margin-top-10">
                <div class="text-align-center">
                    <button style="width: 80px;margin-right: 20px" type="submit" class="btn btn-blue"
                            id="editFormSubmitBtn_${serializeNum}">确定
                    </button>
                    <input style="width: 80px" type="button" class="btn btn-blue" data-dismiss="modal" value="取消"
                           />
                </div>
            </div>
        </div>
       <!-- <div class="disposable hidden">
            <#if (true && editModel=='add')||(true && editModel=='edit')>
                <div class="col-xm-12 col-sm-6 col-lg-12 margin-bottom-20">
                    <div class="form-group">
                        <label for="sumPrice"
                               class="col-sm-3 col-sm-offset-1 control-label no-padding-right"><span style="color: red">*</span>一次性物品费：</label>
                        <label class="col-sm-6">
                            <label>
                                <input class="form-control" type="text">
                            </label>
                            <label>
                                元
                            </label>
                        </label>
                    </div>
                </div>
            </#if>
            <#if (true && editModel=='add')||(true && editModel=='edit')>
                <div class="col-xm-12 col-sm-6 col-lg-12 margin-bottom-20">
                    <div class="form-group">
                        <label for="remark" class="col-sm-3 col-sm-offset-1 control-label no-padding-right">费用说明：</label>
                        <div class="col-sm-6">
                            <textarea class="form-control" size="500" rows="2" style="resize:none"></textarea>
                        </div>
                    </div>
                </div>
            </#if>
            <div class="col-sm-12 margin-bottom-20 margin-top-10">
                <div class="text-align-center">
                    <button style="width: 80px;margin-right: 20px" type="submit" class="btn btn-blue"
                            id="editFormSubmitBtn_${serializeNum}">确定
                    </button>
                    <input style="width: 80px" type="button" class="btn btn-blue" data-dismiss="modal" value="取消"
                           onclick="backView()"/>
                </div>
            </div>
        </div>
        <div class="other hidden">
            <div class="col-sm-12 margin-bottom-20 margin-top-10">
                <div class="text-align-center">
                    <button style="width: 80px;margin-right: 20px" type="submit" class="btn btn-blue"
                            id="editFormSubmitBtn_${serializeNum}">确定
                    </button>
                    <input style="width: 80px" type="button" class="btn btn-blue" data-dismiss="modal" value="取消"
                           onclick="backView()"/>
                </div>
            </div>
        </div>-->
    </form>
</div>
<script src="assets/js/validation/bootstrapValidator_init.js"></script>
<script>
    function ajaxPackageList(type) {
        ajaxRequest("tssPackageController/ajaxPackageListByType.do", {
            type: type
        }, function (result) {
            var data = result.data;
            var arr = ['<option value="0">请选择</option>'];
            if (type == 1) {
                for (var i = 0; i < data.length; i++) {
                    //arr.push('<option value="'+t.id+'">'+t.name+'</option>')
                    arr.push('<option  value="' + data[i].id + '" packageId="' + data[i].id + '" packageOriginalUnitPrice="' + data[i].originalUnitPrice + '" packageValidDate="' + data[i].validDate + '" packageTotalClassHour="' + data[i].totalClassHour + '" packageSumPrice="' + data[i].sumPrice +'" >' + data[i].name + '</option>')
                }
                $('#dearSonPackageId').html(arr.join(''));
            } else {
                for (var i = 0; i < data.length; i++) {
                    //arr.push('<option value="'+t.id+'">'+t.name+'</option>')
                    arr.push('<option  value="' + data[i].id + '" packageId="' + data[i].id + '" packageOriginalUnitPrice="' + data[i].originalUnitPrice + '" packageValidDate="' + data[i].validDate + '" packageAttendanceDay="' + data[i].attendanceDay +'" packageSumPrice="' + data[i].sumPrice + '" >' + data[i].name + '</option>')
                }
                $('#packageId').html(arr.join(''));
            }
            //$('#dearSonPackageId').html(arr.join(''))

        }, function () {
            ajaxError("加载课程包失败")
        }, "get", "json")
    }

    function ajaxStaffList() {
        ajaxRequest("sysAdminUserController/getPostListByDuty.do", {
            duty: 1
        }, function (result) {
            var data = result.data;
            var arr = ['<option value="0">请选择</option>'];
            for (var i = 0; i < data.length; i++) {
                arr.push('<option value="' + data[i].id + '">' + data[i].realName + '</option>')
            }
            $('#dearSonStaffId').html(arr.join(''));
            $('#adminUserId').html(arr.join(''));
        }, function () {
            ajaxError("加载员工信息失败");
        }, "post", "json")
    };
    $(function () {
        var type = 1;
        ajaxPackageList(type);
        ajaxStaffList();
    });


    $(".selectpicker_${serializeNum}").select2();

    $("#editForm_${serializeNum}").bind("ajaxSubmitCallback", function (event, result) {
        alert(result.resMsg);
        if (result.resCode == 200) {
            bootbox.hideAll();
        }
    });

    $(".parentChildBtn").click(function () {

        $(".parentChild").removeClass("hidden").addClass("show");
        $(".interim").removeClass("show").addClass("hidden");
        $(".disposable").removeClass("show").addClass("hidden");
        $(".other").removeClass("show").addClass("hidden");

        $('.parentChildBtn').css("background", "#5db2ff");
        $('.interimBtn').css("background", "#fff");
        $('.disposableBtn').css("background", "#fff");
        $('.otherBtn').css("background", "#fff");

        $(".modal-title").html("亲子课时包");

        $(".packageType").val(1);
        var type = $(".packageType").val();
        ajaxPackageList(type)

    })
    $(".interimBtn").click(function () {
        console.log("2");
        $(".interim").removeClass("hidden").addClass("show");
        $(".parentChild").removeClass("show").addClass("hidden");
        $(".disposable").removeClass("show").addClass("hidden");
        $(".other").removeClass("show").addClass("hidden");

        $('.interimBtn').css("background", "#5db2ff");
        $('.parentChildBtn').css("background", "#fff");
        $('.disposableBtn').css("background", "#fff");
        $('.otherBtn').css("background", "#fff");

        $(".modal-title").html("过渡课时包");

        $(".packageType").val(2);
        var type = $(".packageType").val();
        ajaxPackageList(type)

    })

    $(".disposableBtn").click(function () {
        $(".disposable").removeClass("hidden").addClass("show");
        $(".parentChild").removeClass("show").addClass("hidden");
        $(".interim").removeClass("show").addClass("hidden");
        $(".other").removeClass("show").addClass("hidden");

        $('.disposableBtn').css("background", "#5db2ff");
        $('.parentChildBtn').css("background", "#fff");
        $('.interimBtn').css("background", "#fff");
        $('.otherBtn').css("background", "#fff");

        $(".modal-title").html("一次性物品缴费");
    })

    $(".otherBtn").click(function () {
        $(".other").removeClass("hidden").addClass("show");
        $(".parentChild").removeClass("show").addClass("hidden");
        $(".interim").removeClass("show").addClass("hidden");
        $(".disposable").removeClass("show").addClass("hidden");

        $('.otherBtn').css("background", "#5db2ff");
        $('.parentChildBtn').css("background", "#fff");
        $('.interimBtn').css("background", "#fff");
        $('.disposableBtn').css("background", "#fff");

        $(".modal-title").html("其他");
    })

    /**
     * 选择课时包
     * @param that
     */
    function packageCheck(that) {
        var id = $(that).attr("id");
        if (id == 'dearSonPackageId') {
            var packageId = $("#dearSonPackageId").find("option:selected").attr("packageId");
            var packageOriginalUnitPrice = $("#dearSonPackageId").find("option:selected").attr("packageOriginalUnitPrice");
            var packageTotalClassHour = $("#dearSonPackageId").find("option:selected").attr("packageTotalClassHour");
            var packageValidDate = $("#dearSonPackageId").find("option:selected").attr("packageValidDate");
            var packageSumPrice = $("#dearSonPackageId").find("option:selected").attr("packageSumPrice");

            console.log(packageId);
            console.log(packageOriginalUnitPrice);
            console.log(packageValidDate);
            console.log(packageTotalClassHour);

            $('input[name="dearSonOriginalUnitPrice"]').eq(0).val(packageOriginalUnitPrice);
            $('input[name="classHour"]').eq(0).val(packageTotalClassHour);
            $('input[name="dearSonPackageSumPrice"]').eq(0).val(packageSumPrice);
            $('input[name="dearSonValidDate"]').eq(0).val(packageValidDate);
        } else {
            var packageId = $("#packageId").find("option:selected").attr("packageId");
            var packageOriginalUnitPrice = $("#packageId").find("option:selected").attr("packageOriginalUnitPrice");
            var packageAttendanceDay = $("#packageId").find("option:selected").attr("packageAttendanceDay");
            var packageValidDate = $("#packageId").find("option:selected").attr("packageValidDate");
            var packageSumPrice = $("#packageId").find("option:selected").attr("packageSumPrice");

            console.log(packageOriginalUnitPrice);

            $('input[name="originalUnitPrice"]').eq(0).val(packageOriginalUnitPrice);
            $('input[name="packageAttendanceDay"]').eq(0).val(packageAttendanceDay);
            $('input[name="packageSumPrice"]').eq(0).val(packageSumPrice);
            $('input[name="validDate"]').eq(0).val(packageValidDate);


        }
    }

    function calculation(that) {
        var type = $(".packageType").val();
        console.log("type:" + type);
        if(type == 1){
            var nowUnitPrice = $(that).val();
            console.log("nowUnitPrice:" + nowUnitPrice);

            var packageTotalClassHour = $('input[name="classHour"]').val();
            console.log("packageTotalClassHour:" + packageTotalClassHour);

            var sum = nowUnitPrice * packageTotalClassHour;
            console.log("sum:" + sum);

            var deposit = $('input[name="dearSonDeposit"]').val();
            console.log("deposit:" + deposit);

            sum = sum-deposit;
            console.log("sum:" + sum);

            $('input[name="dearSonSumPrice"]').val(sum);
        }else{
            var nowUnitPrice = $(that).val();
            console.log("nowUnitPrice:" + nowUnitPrice);

            var packageTotalClassHour = $('input[name="packageAttendanceDay"]').val();
            console.log("packageTotalClassHour:" + packageTotalClassHour);

            var sum = nowUnitPrice * packageTotalClassHour;
            console.log("sum:" + sum);

            var deposit = $('input[name="deposit"]').val();
            console.log("deposit:" + deposit);

            sum = sum-deposit;
            console.log("sum:" + sum);

            $('input[name="sumPrice"]').val(sum);

        }
    }
    function mealFeeCalculation(that){
        var dayMealFee = $(that).val();
        console.log("dayMealFee:" + dayMealFee);
        var sum = 0;

        var packageAttendanceDay = $('input[name="packageAttendanceDay"]').val();
        console.log("packageAttendanceDay:" + packageAttendanceDay);

        var attendanceDay = $('input[name="attendanceDay"]').val();
        console.log("attendanceDay:" + attendanceDay);
        if(packageAttendanceDay == ""){
            alert(1)
        }
        if(attendanceDay == ""){
            sum = packageAttendanceDay*dayMealFee;
        }else{
            sum = (parseInt(packageAttendanceDay)+parseInt(attendanceDay))*dayMealFee;
        }
        console.log("sum:" + sum);

        $('input[name="totalMealFee"]').eq(0).val(sum);


    }
</script>